package com.fulong.service;

import com.fulong.mapper.Usermapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;




/**
 * Userservice class
 *
 * @author fulong
 * @date
 */
@Service
public class Userservice {
    public static Map<String , String> registerList = new HashMap<>();
    @Autowired
    Usermapper usermapper;

    /**
     *
     * 登陆账号查询
     */
    public Map<String, Object> qureyUerLogin(String id ) {
        Map<String, Object> userPwd = usermapper.user_login(id);

        return userPwd;
    }

    /**
     * 用户修改密码
     *
     */
    public boolean alterUserpwd(String id , String newPwd) {
        try {
            usermapper.alterPwd(id , newPwd);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true ;
    }

    /**
     *授权服务
     */
    public void registerLoginSession(HttpServletResponse response, HttpServletRequest request, HttpSession session , String userid) {

    }
}
